<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgenciesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agencies', function (Blueprint $table) {
            $table->id();
            $table->integer('order')->default(0)->comment('顺序序号');
            $table->string('name')->comment('代理机构');
            $table->string('agent', 20)->nullable()->comment('联系人');
            $table->string('phone', 20)->nullable()->comment('联系电话');
            $table->string('mailbox', 50)->nullable()->comment('邮箱');
            $table->string('fax', 20)->nullable()->comment('传真');
            $table->string('address')->nullable()->comment('地址');
            $table->string('remark')->nullable()->comment('备注');
            $table->tinyInteger('enabled')->default(1);
            $table->integer('user_id')->default(0)->comment('账号关联ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agencies');
    }
}
